<template>
    <div style="background: #fff;min-height: 100vh;">
        <div class="binding-return">
            <i @click="returnHome" class="bindingticon iconfont icon-jiantou"></i>
            <span style="position: absolute;left: calc(50% - 16px);">{{pageName}}</span>
        </div>
        <div style="padding:10px;background: #ededed;">
            <productList @proId="getProId" @numId="getNumId" :dataList="objVla" :urlPathVal="indexUrl"></productList>
        </div>
        <div v-if="creatShareShow" style="position: fixed;top:0;z-index: 1000;width: 100%;">
            <creatShare :numId="numId" @returnPage="returnCurrentPage"></creatShare>
        </div>
    </div>
  </template>
  
  <script>
      import productList from './public/productList.vue';
      import creatShare from './creatShare.vue';
  export default {
    name: 'mallPage',
    data () {
      return {
          pageName:'',
          proId:'',
          numId:'',
          creatShareShow:false,
          objVla:{},
          indexUrl:'jingdongtemai1',
      }
    },
    components: {  
        productList,
        creatShare
    },
    mounted() {        
        var pageStr = this.$route.params.id;
        if(pageStr == 1){
            this.pageName = "爆款特卖";
            this.indexUrl = "jingdongtemai1";
        }
        if(pageStr == 2){
            this.pageName = "超省购";
            this.indexUrl = "jingdongtemai2";
        }
    },
    methods: {
        returnCurrentPage(data){
            this.creatShareShow = data;
        },
        getNumId(data){
            this.numId = data;
            this.creatShareShow = true;
        },
        getProId(data){
            this.proId = data;
        },
        returnHome(){
            this.$router.push('/');
        }
    },
  }
  </script>
  
  <!-- Add "scoped" attribute to limit CSS to this component only -->
  <style scoped>
      @import url("../assets/font/iconfont.css");
      .bindingticon{
            font-size: 18px;
            color: #000000;
            font-weight: 900;
        }
      .binding-return{
        width: 100%;
        padding: 12px 10px 0 10px;
        height: 56px;
        text-align: center;
        position: relative;
        display: flex;
        justify-content: space-between;
          background: #FFFFFF;
    }
    .binding-return span{
        display: block;
        font-size: 16px;
        font-family: PingFangSC-Semibold, PingFang SC;
        font-weight: 600;
        color: rgba(51, 51, 51, 1);
        line-height: 22px;

    }
  </style>
  